package wzc.design_pattern.creation.prototype;

/**
 * @Author 王振川
 * @Date 2025/7/19
 */

public class PrototypePatternDemo {
    public static void main(String[] args) throws CloneNotSupportedException {
        Sheep originalSheep = new Sheep("Dolly", 2, "白色");
        Sheep cloneSheep = (Sheep) originalSheep.clone();

        System.out.println(originalSheep.toString());
        System.out.println(cloneSheep.toString());

        System.out.println("原型对象和克隆对象是否相同？" + (originalSheep == cloneSheep));
    }
}
